<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    var a = "a";
    var obj={
        a,
        b(){
            console.log("b")
        }
    }
    console.log(obj);
</script>
</html>